//
//  BIDDispatchInfoView.m
//  HJGJCommunity
//
//  Created by mal on 2017/6/9.
//  Copyright © 2017年 mal. All rights reserved.
//

#import "BIDDispatchInfoView.h"

@implementation BIDDispatchInfoView
@synthesize delegate;
@synthesize nameLabel;
@synthesize phoneLabel;

- (void)awakeFromNib
{
    [super awakeFromNib];
    _closeBtn.layer.cornerRadius = CGRectGetHeight(_closeBtn.frame)/2;
    _closeBtn.clipsToBounds = YES;
    //
    phoneLabel.userInteractionEnabled = YES;
    UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureHandler:)];
    [phoneLabel addGestureRecognizer:tapGR];
}

- (IBAction)closeBtnHandler:(id)sender
{
    [self removeFromSuperview];
    [delegate removeView];
}

- (void)tapGestureHandler:(UITapGestureRecognizer *)tapGR
{
    if(phoneLabel.text.length > 0)
    {
        [delegate callWithPhone:phoneLabel.text];
    }
}

@end
